package com.itheima;

import javax.servlet.*;
import javax.servlet.Servlet;
import javax.servlet.http.HttpServlet;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class serlet extends HttpServlet {
    @Override
    public void init(ServletConfig servletConfig) throws ServletException {

    }
    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
//      这两个对象参数由tomcat底层创建传过来
        String id = servletRequest.getParameter("id");
        String psw = servletRequest.getParameter("psw");
        System.out.println(id);
        PrintWriter writer = servletResponse.getWriter();
        writer.println(id+":"+psw);

    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }


}
